home *** CD-ROM | disk | FTP | other *** search
/ Scene 96 / Scene 96 International Edition (Zyklop Software) (Disc 2) (1997).iso / misc / coding / 5tinydms / xymode.si < prev   
Text File  |  1995-11-05  |  2KB  |  119 lines

  1.  
  2. *********************************************************
  3. *                                                       *
  4. *  txtmode, ymode and xmode : three useful routines to  *
  5. *    enable X and Y modes, and get back to a text one   *
  6. *       (c)oderight LCA/Infiny and Jedi/Sector One      *
  7. *                                                       *
  8. *********************************************************
  9.  
  10. * Back to the 80x25/16 mode
  11.  
  12. txtmode push a
  13.         move #3,a
  14.         trap #$10
  15.         pop a
  16.         rts
  17.  
  18. * Y-mode : 320x200/256 - 4 pages
  19.  
  20. ymode   push a
  21.         push d
  22.  
  23.         bsr vsync
  24.  
  25.         move #$13,a
  26.         trap #$10
  27.  
  28.         move #$3c4,d
  29.         move.b #4,a
  30.         out.b a,d
  31.         inc.b d
  32.         in.b d,a
  33.         and.b #255-8,a
  34.         or.b #4,a
  35.         out.b a,d
  36.  
  37.         move #$3ce,d
  38.         move.b #6,a
  39.         out.b a,d
  40.         inc.b d
  41.         in.b d,a
  42.         and.b #255-2,a
  43.         out.b a,d
  44.  
  45.         move #$3d4,d
  46.         move.b #$14,a
  47.         out.b a,d
  48.         inc.b d
  49.         in.b d,a
  50.         and.b #255-64,a
  51.         out.b a,d
  52.  
  53.         dec.b d
  54.         move.b #$17,a
  55.         out.b a,d
  56.         inc.b d
  57.         in.b d,a
  58.         or.b #64,a
  59.         out.b a,d
  60.  
  61.         pop d
  62.         pop a
  63.         rts
  64.  
  65. * X-Mode: 320x240/256 - 4 pages
  66.  
  67. xmode   push a
  68.         push d
  69.         bsr ymode
  70.  
  71.         move #$3c2,d
  72.         move.b #%11100011,a
  73.         out.b a,d
  74.  
  75.         move #$3d4,d
  76.         move #$300,a
  77.         out a,d
  78.  
  79.         move #$3d4,d
  80.         move.b #$11,a
  81.         out.b a,d
  82.         inc d
  83.         in.b d,a
  84.         and.b #%01111111,a
  85.         out.b a,d
  86.         dec d
  87.         move #$d06,a
  88.         out a,d
  89.         move #$3e07,a
  90.         out a,d
  91.         move #$4109,a
  92.         out a,d
  93.         move #$ea10,a
  94.         out a,d
  95.         move #$ac11,a
  96.         out a,d
  97.         move #$df12,a
  98.         out a,d
  99.         move #$e715,a
  100.         out a,d
  101.         move #$616,a
  102.         out a,d
  103.  
  104.         pop d
  105.         pop a
  106.         rts
  107.  
  108. * Wait for the vertical frame
  109.  
  110. vsync   push a
  111.         push d
  112.         move #$3da,d
  113. .vswait in.b d,a
  114.         test.b #8,a
  115.         beq.s .vswait
  116.         pop d
  117.         pop a
  118.         rts
  119.